The need for a copy of selected elements of a database in a data processing system arises in many situations. For example, the copy may be used during an error recovery of the system to recreate the database, or it may be used to transfer the database to another system.
A database should be copied without destroying its consistency. To illustrate, consider a database wherein the accounts of two entities, A and B, are kept. Suppose a transaction is made to transfer money from A's account to B's account, the complete operation on the database due to this transaction would involve a process to debit A's account and a process to credit B's account. In order to preserve the consistency of the database copy, it should be made at an instant either before the start of both the debit and the .credit processes, or after the completion thereof. If the copy is made when only one of these two processes is completed or if one of the processes is allowed to occur during the copying, then the consistency of the copy would be destroyed.
Therefore, a copy of a database should be made at a time instant when the processes operating on the database are consider synchronized such synchronization, may be defined by certain criteria, such as the "Two-Phase Commit" protocol. Furthermore, when the copy is being made, the database as it exits at the synchronization time instant should not be disturbed. This typically means inhibiting access to the database so that elements of the database, as it exists at the synchronization point, will not be changed or deleted. But inhibiting access to the database basically means that processing of the data processing system be suspended, resulting in the degradation of the availability of the data processing system.
To avoid system degradation, some computer installations make database copies without suspending processing in the hope that any partially updated information can be repaired should it become necessary to use the copies. Other installations make database copies infrequently and plan to rerun a large portion of the workload during a system recovery.
An object of the present invention is to create a snapshot copy of selected database elements in a data processing system at a time instant when the database is known to be consistent. However, a related object of the invention is such that the copy is created without substantially impacting the availability of the system.